<template>
  <div class="animated fadeIn">
    <div class="card card-accent-primary">
      <b-row>
        <b-col cols="12">
          <Card>
            <div>
              <i-table :loading="loading" border :columns="columns" :data="items"></i-table>
            </div>
          </Card>
        </b-col>
      </b-row>
    </div>
  </div>
</template>
<script>
export default {
  data () {
    return {
      key: '',
      columns: [
        {
          title: 'ID',
          key: 'ma_id',
          width: 50
        },
        {
          title: '菜单名称',
          key: 'showName',
          width: 200
        },
        {
          title: '菜单url',
          key: 'ma_url',
          width: 200
        },
        {
          title: '操作',
          key: 'action',
          align: 'center',
          className: 'table-min-width'
        }
      ],
      items: [],
      loading: true
    }
  },
  methods: {
    // 获取列表
    getList () {
      this.$get('/api/admin/menuAuth', {
        params: {
          menu: 1
        }
      }).then((res) => {
        if (res) {
          this.items = res.data
          this.loading = false
        }
      })
    }
  },
  created () {
    this.getList()
  }
}
</script>
<style>
  /*解决table表格适应问题*/
  .table-min-width {
    min-width: 200px;
    width: 200px;
  }
</style>
